<html>
<head><meta charset="utf-8"><title>Stop ignoring trailing semicolons in a macro b… lang-team#70 · t-lang/major changes · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/index.html">t-lang/major changes</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html">Stop ignoring trailing semicolons in a macro b… lang-team#70</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="217320766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217320766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> triagebot <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217320766">(Nov 19 2020 at 19:45)</a>:</h4>
<p>A new proposal has been announced: <a href="https://github.com/rust-lang/lang-team/issues/70">Stop ignoring trailing semicolons in a macro body when a macro is invoked in expression position #70</a>. It will be announced at the next meeting to try and draw attention to it, but usually MCPs are not discussed during triage meetings. If you think this would benefit from discussion amongst the team, consider proposing a design meeting.</p>



<a name="217324078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217324078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217324078">(Nov 19 2020 at 20:11)</a>:</h4>
<p>this change seems really desirable to me</p>



<a name="217335576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217335576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217335576">(Nov 19 2020 at 21:52)</a>:</h4>
<p>It seems desirable, but the impact seems pretty bad :(</p>



<a name="217335612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217335612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217335612">(Nov 19 2020 at 21:52)</a>:</h4>
<p>I was wondering if it's something we can do over an edition but I guess that would belie some of the motivation probably? (which I imagine is to improve the implementation)</p>



<a name="217336011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217336011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217336011">(Nov 19 2020 at 21:55)</a>:</h4>
<p>I made a small comment in the issue about doing this over an edition</p>



<a name="217336113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217336113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217336113">(Nov 19 2020 at 21:56)</a>:</h4>
<p>the impact on the implementation is quite minimal either way - this is mainly about making the behavior of macro and expression parsing more consistent</p>



<a name="217336170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217336170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217336170">(Nov 19 2020 at 21:56)</a>:</h4>
<p>there are all the usual caveats about macro-related edition changes (proc-macros can respan things in a way that we can't detect)</p>



<a name="217336281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217336281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217336281">(Nov 19 2020 at 21:57)</a>:</h4>
<p>However, we could probably cover 99% of the breakage by continuing to accept trailing semicolons if the semicolon has a 2015/2018 edition span</p>



<a name="217343117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217343117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217343117">(Nov 19 2020 at 23:06)</a>:</h4>
<p><span class="user-mention" data-user-id="125294">@Aaron Hill</span> What breakage would that not address?</p>



<a name="217343146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217343146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217343146">(Nov 19 2020 at 23:07)</a>:</h4>
<p>Weird cases where a proc-macro is setting the span of tokens</p>



<a name="217343169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217343169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217343169">(Nov 19 2020 at 23:07)</a>:</h4>
<p>Ah.</p>



<a name="217343208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217343208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217343208">(Nov 19 2020 at 23:07)</a>:</h4>
<p>Are you aware of any cases where the intersection of that <em>and</em> semicolons at the end of expression macros is non-zero?</p>



<a name="217343219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217343219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217343219">(Nov 19 2020 at 23:07)</a>:</h4>
<p>No</p>



<a name="217343281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217343281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217343281">(Nov 19 2020 at 23:08)</a>:</h4>
<p>However, I know of one crate that does the kind of re-spanning that is potentially problematic</p>



<a name="217343322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217343322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217343322">(Nov 19 2020 at 23:08)</a>:</h4>
<p>I pr'd a proc-macro to solana which respans certain tokens using the spans of other tokens</p>



<a name="217343351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217343351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217343351">(Nov 19 2020 at 23:09)</a>:</h4>
<p>In that case, the macro is only used internally</p>



<a name="217343365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217343365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217343365">(Nov 19 2020 at 23:09)</a>:</h4>
<p>and will never run into this problem</p>



<a name="217343382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217343382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217343382">(Nov 19 2020 at 23:09)</a>:</h4>
<p>But there's at least one case where writing that kind of respanning code is necessary</p>



<a name="217343529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217343529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217343529">(Nov 19 2020 at 23:11)</a>:</h4>
<p>An alternative would be to use the edition of the crate that defines the macro</p>



<a name="217343568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217343568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217343568">(Nov 19 2020 at 23:12)</a>:</h4>
<p>That would run into issues with 'meta-macros' that expand to other macros</p>



<a name="217343616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217343616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217343616">(Nov 19 2020 at 23:12)</a>:</h4>
<p>I'm not sure which strategy would be better</p>



<a name="217343916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217343916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217343916">(Nov 19 2020 at 23:17)</a>:</h4>
<p>My hope is that <code>cargo future-incompat-report</code> will help to make any breakage rare by the time we decide to make this a hard error</p>



<a name="217344887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217344887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217344887">(Nov 19 2020 at 23:30)</a>:</h4>
<p>That is, people will have already bumped their upstream deps, so any edition-compatibility mechanism will rarely be used</p>



<a name="217367531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217367531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> isHavvy <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217367531">(Nov 20 2020 at 06:51)</a>:</h4>
<p>Is there any reason to go through a breaking change in <code>macro_rules</code> when it can just be fixed in Macros 2.0?</p>



<a name="217417772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217417772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217417772">(Nov 20 2020 at 15:47)</a>:</h4>
<p>This is more of a bugfix (of a very old bug) then a feature change</p>



<a name="217418047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/217418047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#217418047">(Nov 20 2020 at 15:49)</a>:</h4>
<p>It also makes macros more consistent with the rest of the language, so I don't think it should be limited to macros 2.0</p>



<a name="224074078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/224074078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#224074078">(Jan 26 2021 at 17:33)</a>:</h4>
<p>I'd like to take action here</p>



<a name="224074133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/224074133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#224074133">(Jan 26 2021 at 17:34)</a>:</h4>
<p>This has been pending way longer than I would like =)</p>



<a name="224096672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/224096672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#224096672">(Jan 26 2021 at 20:17)</a>:</h4>
<p>I have a PR open in <a href="https://github.com/rust-lang/rust/pull/79819">https://github.com/rust-lang/rust/pull/79819</a></p>



<a name="224096729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/224096729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#224096729">(Jan 26 2021 at 20:17)</a>:</h4>
<p>However, it's blocked on me figuring out a better way to handle allowing the lint</p>



<a name="224096836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/224096836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#224096836">(Jan 26 2021 at 20:18)</a>:</h4>
<p>it needs to apply to a macro calls, which makes things tricky</p>



<a name="224096989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/224096989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#224096989">(Jan 26 2021 at 20:19)</a>:</h4>
<p>I'd like to be able to allow the lint as close as possible to the actual macro call</p>



<a name="224097254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/224097254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#224097254">(Jan 26 2021 at 20:22)</a>:</h4>
<p>so, <code>#[allow(macro_trailing_semicolon)] my_macro!()</code> won't work , but I'd like  <code>#[allow(macro_trailing_semicolon)] let a = my_macro!();</code> to work</p>



<a name="224103401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/224103401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#224103401">(Jan 26 2021 at 21:08)</a>:</h4>
<p>Ah, interesting, ok. Thanks <span class="user-mention" data-user-id="125294">@Aaron Hill</span></p>



<a name="224103429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/224103429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#224103429">(Jan 26 2021 at 21:08)</a>:</h4>
<p>We were going to close the MCP in any case and mark it as accepted, pending PR</p>



<a name="224119613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/224119613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#224119613">(Jan 26 2021 at 23:29)</a>:</h4>
<p><span class="user-mention silent" data-user-id="125294">Aaron Hill</span> <a href="#narrow/stream/243200-t-lang.2Fmajor-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370/near/224096989">said</a>:</p>
<blockquote>
<p>I'd like to be able to allow the lint as close as possible to the actual macro call</p>
</blockquote>
<p>I mentioned on the PR that <code>fn lint_node_id</code> can be used to obtain the closest parent node with a <code>DefId</code>, it's good enough to land the lint implementation, IMO.<br>
Later we could add some infra for tracking this more precisely, with <code>NodeId</code> granularity, but that would be an entirely orthogonal work.</p>



<a name="224121422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/224121422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#224121422">(Jan 26 2021 at 23:51)</a>:</h4>
<p>My concern was that it could be very confusing for users for <code>#[allow(macro_trailing_semicolon)] fn foo() { macro_call!(); } </code> to work, but not <code>#[allow(macro_trailing_semicolon)] let a = my_macro!();</code></p>



<a name="224121437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/224121437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#224121437">(Jan 26 2021 at 23:51)</a>:</h4>
<p>but I guess we could land it as allow-only, and follow up later like you said</p>



<a name="224121443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/224121443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#224121443">(Jan 26 2021 at 23:51)</a>:</h4>
<p>I'll update the PR</p>



<a name="224909709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Stop%20ignoring%20trailing%20semicolons%20in%20a%20macro%20b%E2%80%A6%20lang-team%2370/near/224909709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> triagebot <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Stop.20ignoring.20trailing.20semicolons.20in.20a.20macro.20b.E2.80.A6.20lang-team.2370.html#224909709">(Feb 02 2021 at 17:55)</a>:</h4>
<p>This proposal has been accepted: <a href="https://github.com/rust-lang/lang-team/issues/70">#70</a>.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>